package com.syt.service.service;

import com.syt.service.dao.PhoneConfigMapper;
import com.syt.service.dao.PhoneShowMapper;
import com.syt.service.pojo.PhoneConfig;
import com.syt.service.pojo.PhoneShow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：syt
 * @date ：Created in 2019-10-02 10:58
 * @description：屏幕数据 service
 */
@Service
public class PhoneShowService {

    @Autowired(required = false)
    PhoneShowMapper mapper;

    /**
     * 删除屏幕数据 根据id
     * @param id
     * @return
     */
    public int deleteById(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    /**
     * 完全插入 屏幕数据
     * @param show
     * @return
     */
    public int insert(PhoneShow show) {
        return mapper.insert(show);
    }

    /**
     * 选择插入 屏幕数据
     * @param show
     * @return
     */
    public int insertBySelective(PhoneShow show) {
        return mapper.insertSelective(show);
    }

    /**
     * 根据id查询 屏幕数据
     * @param id
     * @return
     */
    public PhoneShow getById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    /**
     * 选择性更新 屏幕数据
     * @param show
     * @return
     */
    public int updateBySelective(PhoneShow show) {
        return mapper.updateByPrimaryKeySelective(show);
    }

    /**
     * 完全更新 屏幕数据
     * @param show
     * @return
     */
    public int update(PhoneShow show) {
        return mapper.updateByPrimaryKey(show);
    }

}
